﻿namespace WMS6.Web.Billing
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class AccessorialQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlAccessorialID;
        protected DropDownList ddlBillingServiceID;
        protected DropDownList ddlGeneralLedgerID;
        protected DropDownList ddlIsActive;
        protected DropDownList ddlIsActiveOper;
        protected DropDownList ddlOwnerID;
        protected HtmlForm F9170;
        protected HtmlInputHidden hdnActionID;
        protected HtmlHead Head1;
        protected Label lblAccessorialID;
        protected Label lblBillingServiceID;
        protected Label lblGeneralLedgerID;
        protected Label lblIsActive;
        protected Label lblOwnerID;
        protected Label lblSubject;
        protected HtmlLink mycss;
        protected ScriptManager ScriptManager1;
        protected TextBox txtAccessorialID;
        protected TextBox txtBillingServiceID;
        protected TextBox txtGeneralLedgerID;
        protected TextBox txtOwnerID;

        protected void btnList_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("AccessorialList.aspx?action={0}&from=list", base.UrlEncode(this.hdnActionID.Value.Trim())), false);
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("AccessorialList.aspx?action=" + base.UrlEncode(this.hdnActionID.Value), false);
        }

        private void LoadDDl()
        {
            base.InitQueryDDL(this.ddlBillingServiceID, 0);
            base.InitQueryDDL(this.ddlAccessorialID, 0);
            base.InitQueryDDL(this.ddlGeneralLedgerID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlIsActiveOper, 0);
            base.InitIsActiveDDL(this.ddlIsActive, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            base.InitPage(this.Page);
            this.LoadDDl();
        }

        public string AccessorialID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtAccessorialID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtAccessorialID.Text.Trim(), this.ddlAccessorialID.SelectedValue);
                }
                return "";
            }
        }

        public string BillingServiceID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtBillingServiceID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtBillingServiceID.Text.Trim(), this.ddlBillingServiceID.SelectedValue);
                }
                return "";
            }
        }

        public string GeneralLedgerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtGeneralLedgerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtGeneralLedgerID.Text.Trim(), this.ddlGeneralLedgerID.SelectedValue);
                }
                return "";
            }
        }

        public string IsActive
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlIsActive.Text.Trim()))
                {
                    return base.GetParamsString(this.ddlIsActive.Text.Trim(), this.ddlIsActiveOper.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }
    }
}

